<%@ page language="java" import="java.util.*,org.cx.oa.entity.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'sendMail.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script language="javasctipt" type="text/javascript">  
//提交查询内容   
    function userCheck() {   
    var condId = document.getElementById("to");   
    var text = condId.value;   
    var textValue = text.replace(/(^\s*)|(\s*$)/g, "");     //替换输入内容当中所有的空字符，包括全角空格，半   
    if(textValue==null || textValue=="") { 
    	document.getElementById("usertd").innerText="收件人邮箱不能为空"; 
    	document.getElementById("sub").disabled=true;  
        return;  
    }   
    document.getElementById("usertd").innerText="*收件人邮箱"; 
       document.getElementById("sub").disabled=false;  
    }  
    function show(v){
    alert(v.value);
    }
    

</script>
	
  </head>
  
  
  <body bgcolor="#EEF2FB">
  <%
  
		 MailClient client=(MailClient)session.getValue("mailuser");
		 
		 if(client!=null){
   %>
  

	<form action="senmail" method="post">
		<table>
			<tr>
				<td colspan="2"><input type="hidden"  name="m.user" value="<%= client.getUser() %>"></input>发件人：<%= client.getUser() %></td>
			</tr>
			<tr>
				<td colspan="2"><input type="hidden" name="m.pass" value="<%= client.getPass() %>"></input>
				</td>
			</tr>
			<tr>
				<td ><font color="red" id="usertd">*收件人邮箱：</font></td>
				<td><input type="text" name="m.from" value="514435771@qq.com" id="to" onblur="userCheck()"></input></td>
			</tr>
			<tr>
				<td>主题：</td>
				<td><input type="text" name="m.title"></input>
				</td>
			</tr>
			
				<tr>
				<td colspan="2">
				<textarea name="m.content">
			</textarea>
			<script type="text/javascript">
				var editor = CKEDITOR.replace('m.content');
			</script>
				</td>
				
			</tr>
			<tr>
				<td colspan="2">
				<input type="file" name="m.file"></input>
				</td>
				</tr>
			<tr>
				<td ><input type="submit" value="发送" id="sub"></input>
				</td><td><input type="button" value="取消" onclick="javascript:history.go(-1);"></input>
				</td>
				</tr>
			
		</table>
		
		
	</form>
<%
}else{
 %>
  <h1>请先登陆邮箱</h1>
 <%
 }
  %>
  </body>
</html>
